<?php
	$posttext = $post->post_content;
//	$posttext1 = $post->post_content;
	$regular_expression = '~src="[^"]*"~';
//	$regular_expression1 = '~<img [^\>]*\ />~';
	$regular_expression2 = '~title="[^"]*"~';
	preg_match_all( $regular_expression, $posttext, $allpics );
	preg_match_all( $regular_expression2, $posttext, $alltitles );
	$NumberOfPics = count($allpics[0]);
//	$only_post_text = preg_replace( $regular_expression1, '' , $posttext);
?>
<div id="box" style="top:500px;">
<ul id="slider">
		<?php	
		if ( $NumberOfPics > 0 ) 
		{		
			for ( $i=0; $i < $NumberOfPics ; $i++ ) 
			{          
			$str1=$allpics[0][$i];
			$str1=trim($str1);
			$len=strlen($str1);
			$imgpath=substr_replace(substr($str1,5,$len),"",-1);			
			$str2=$alltitles[0][$i];
			$str2=trim($str2);
			$len2=strlen($str2);
			$title=substr_replace(substr($str2,7,$len2),"",-1);			
		?>				
	<li id="_<?php print $len; ?>" >
		<img src="<?php echo bloginfo('template_url');?>/thumb/timthumb.php?src=<?php echo $imgpath;?>&amp;w=690&amp;h=500&amp;zc=2&amp;q=90" alt="<?php echo $title;?>" width="690" height="500" />
		<p><span><?php echo $title;?></span></p>
	</li>
	<?php 
		};		 
	};
	?>
</ul>
<ul id="thumb">
		<?php	
		if ( $NumberOfPics > 0 ) 
		{		
			for ( $i=0; $i < $NumberOfPics ; $i++ ) 
			{          
			$str1=$allpics[0][$i];
			$str1=trim($str1);
			$len=strlen($str1);
			$imgpath=substr_replace(substr($str1,5,$len),"",-1);			

		?>

	<li><a href="#_<?php print $len; ?>"><img src="<?php echo bloginfo('template_url');?>/thumb/timthumb.php?src=<?php echo $imgpath;?>&amp;w=65.5&amp;h=65.5&amp;zc=2&amp;q=100" alt="<?php echo $title;?>" width="80" height="80" /></a></li>
	<?php 
		};		 
	};
	?>
</ul>
		

</div>

<div style="clear:both;"></div>
<br>
<h3 style="color:orange;text-align:center;">
	<blink><?php echo get_post_meta($post->ID, 'my_meta_box_select', true); ?></blink>			
</h3>
<br/>
<?php //echo $only_post_text; ?>
<?php the_content();?>

